<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>基础语法</title>
		<script>
			//定义时无需给定数据类型,但是本质上还是有类型的
			var i = 3;
			var j = "4";
			var r = i + j;
			document.write(i + j);
			
			//查看变量的真正数据类型
			document.write(typeof(i));//number
			document.write(typeof(j));//string
			
			document.write("<hr/>");
			
			//定义数组
			var arr = ["AA","BB","CC","DD"];
			for(var i = 0;i < arr.length;i++){
				document.write(arr[i] + "<br/>");
			}
			
			document.write("<hr/>");
			
			//创建日期类型
			var date = new Date();
			var weekday = date.getDay();
			if(weekday == 3){
				document.write("星期三");
			}
			
			document.write("<hr/>");
			
			var max = Math.max(3,4);
			document.write(max);
			
			document.write("<hr/>");
			
			var a;
			document.write(a);//undefined
			
			document.write("<hr/>");
			
			//全局函数
			//var num = parseInt("a8a");//NaN = Not a number
			var num = parseInt("8a");//8
			document.write(num + 1);//9
			
			document.write(9 / 0);//Infinity 
		</script>
	</head>
	<body>
		
	</body>
</html>
